﻿using Kendo.Mvc.UI;
using KendoUIGridSignalR.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Kendo.Mvc.Extensions;

namespace KendoUIGridSignalR.Controllers
{
    // Author: Otto Neff | webapps-in-action.com
    public class HomeController : Controller
    {
        public ActionResult Read([DataSourceRequest] DataSourceRequest request)
        {
            List<StockData> stock = new List<StockData> 
            { 
                new StockData { Name = "A", Price = (decimal)0.0, LastChange = DateTime.Now },
                new StockData { Name = "B", Price = (decimal)0.0, LastChange = DateTime.Now },
                new StockData { Name = "C", Price = (decimal)0.0, LastChange = DateTime.Now } 
            };
            return Json(stock.ToDataSourceResult(request));
        }
        
        public ActionResult Index()
        {           
            return View();
        }
    }
}
